package behaviour.observer_java;

import java.util.Observable;
import java.util.Observer;

/**
 * 观察者
 *
 * @author yeyangtao created at 2020/7/7 14:55
 */
public class Watcher implements Observer {
    public Watcher(Watched w) {
        w.addObserver(this);
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println("changed");
    }
}
